import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'

/* 城市分站统计 */
export function citySubstationStatistics (data) {
  return request({
    url: '/jcdSys/citySubstation/citySubstationStatistics',
    method: 'get',
    headers: encryptionData(data, '/citySubstation/citySubstationStatistics'),
    params: data
  })
}

/* 一健登录 获取 密码 */
export function substationLogin (data) {
  return request({
    url: '/jcdSys/citySubstation/substationLogin',
    method: 'get',
    headers: encryptionData(data, '/citySubstation/substationLogin'),
    params: data
  })
}

/*  合伙人列表 */
export function getCitySubstationList (data) {
  return request({
    url: '/jcdSys/citySubstation/page',
    method: 'get',
    headers: encryptionData(data, '/citySubstation/page'),
    params: data
  })
}

/* 合伙人-添加 */
export function addCitySubstation (data) {
  return request({
    url: '/jcdSys/citySubstation/save',
    method: 'post',
    headers: encryptionData(data, '/citySubstation/save'),
    data: Qs.stringify(data)
  })
}

/* 合伙人-修改 */
export function updCitySubstation (data) {
  return request({
    url: '/jcdSys/citySubstation/update',
    method: 'put',
    headers: encryptionData(data, '/citySubstation/update'),
    data: Qs.stringify(data)
  })
}

/* 删除合伙人 */
export function delCitySubstation (id) {
  return request({
    url: `/jcdSys/citySubstation/delete/${id}`,
    method: 'put',
    headers: encryptionData({}, `/citySubstation/delete/${id}`)
  })
}

/* 激活合伙人 */
export function activeCitySubstation (id) {
  return request({
    url: `/jcdSys/citySubstation/active/${id}`,
    method: 'put',
    headers: encryptionData({}, `/citySubstation/active/${id}`)
  })
}

/* 获取详情 */
export function getCitySubstationDetail (data) {
  return request({
    url: `/jcdSys/citySubstation/getInfo`,
    method: 'get',
    headers: encryptionData(data, `/citySubstation/getInfo`),
    params: data
  })
}

/* 城市合伙人管理-重置密码 */
export function resetCitySubstationPsd (data) {
  return request({
    url: '/jcdGys/resetCitySubstationPsd',
    method: 'post',
    headers: encryptionData(data, '/resetCitySubstationPsd'),
    data: Qs.stringify(data)
  })
}
